#!/bin/bash

/sbin/iptables -P INPUT ACCEPT
/sbin/iptables -F -t filter
/sbin/iptables -F -t nat
/sbin/iptables -X
/sbin/iptables -Z

# Here are some iptables command sentenses.
# ...
iptables -A INPUT -s 172.16.1.1 -j ACCEPT
iptables -A INPUT -p tcp --dport 22 -j ACCEPT


grep include /etc/sysconfig/nftables.conf |grep custom.nft &> /dev/null
if [ $? -ne 0 ]
then
echo 'include "/etc/nftables/custom.nft"' >> /etc/sysconfig/nftables.conf
fi

nft list ruleset >/etc/nftables/custom.nft

systemctl enable nftables
systemctl restart nftables
